package com.chuangjiangx.micreservice.config.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试用接口
 *
 * @author 马文韬
 * @version 1.0
 * @date: 2018/9/28
 */
@RestController
@RefreshScope
public class TestController {

    @Autowired
    private Environment environment;

    @Value("${from}")
    private String value;

    @RequestMapping("/from")
    @ResponseBody
    public String from() {
        return environment.getProperty("from");
    }

}
